<template>
  <div class="business_see">
    <div class="title">
    	<span class="left">业务类型详情</span>
    	<el-button class="add" type="primary" size="small" icon="el-icon-back" @click="$router.back(-1)">返回
    	</el-button>
    </div>
    <div class="main">
      <el-form ref="form"  label-width="100px">
        <el-form-item label="业务名称：">
          <div class="textInner">{{obj.businessName}}</div>
        </el-form-item>
        <el-form-item label="业务描述：">
          <div  class="textInner">
            <ul>
				<li v-for="(item,index) in contArr" :key="index">{{item}}</li>
			</ul>
          </div>
        </el-form-item>
      </el-form>
    </div>
  </div>
</template>
<script>
  import titleDiv from './view/titleDiv.vue'
  import {orgDetailBusiness} from '../api/getData.js'
  export default {
    name: 'business_see',
    data: function () {
		return {
			businessId:'',
			obj:{},
			contArr:[]
		}
    },
    components:{
      titleDiv
    },
    created() {
		this.getParams()
	}, // 创建时
    beforeMount: function () {}, // 挂载之前
    mounted() {
		this.getDetail()
	}, // 挂载之后
    beforeUpdate: function () {}, // 数据更新时调用,在渲染之前
    updated: function () {}, // 数据更新后,渲染后调用(禁止)
    beforeDestroy: function () {}, // 实例销毁前调用,解绑中间层的数据传输
    destroyed: function () {}, // 实例销毁后调用
    methods: {
		getParams(){
			console.log(this.$route.query.id,"传来的参数")
			this.businessId = this.$route.query.id 
		},
		getDetail(){
			orgDetailBusiness({
				id:this.businessId
			}).then((res) =>{
				console.log(res.data,"机构业务类型详情")
				if(res.data.code === 0){
					this.obj = res.data.data
					this.contArr = res.data.data.businessDescription.split("\n")
				}
			}).catch((error) =>{
				console.log(error)
			})
		}
	} // 函数
  }
</script>
<style lang='scss'>
  .business_see {
    box-sizing: border-box;
	.title {
		display: flex;
		justify-content: space-between;
		align-items: center;
		height: 64px;
		line-height: 64px;
		background: #fff;
		overflow: hidden;
		text-align: left;
		padding: 0 20px;
		color: #333437;
		font-size: 16px;
	}
    .main{
      background: #fff;
      width: 100%;
      margin-top: 3%;
      padding: 5% 20%;
      .textInner{
        color: #808492;
        font-size: 12px;
      }
      .el-form-item__label{
        font-weight: bold;
      }
      .btn{
        width: 120px;
        height:32px;
        line-height: 1px;
        margin-left: 100px;
      }
      .btnsc{
        background-color: #fff;
        border:1px solid #ccc;
        color: #ccc;
      }
    }
  }
</style>
